package com.pxxy.springmvc.mapper;

import com.pxxy.springmvc.entity.Account;
import org.apache.ibatis.annotations.*;

import java.io.Serializable;
import java.util.List;

/*****
 * 帐户持久层
 */
//@Mapper
public interface AccountMapper {

    /*@Insert("insert into t_account(id,owner, pin_code, balance)\n" +
            "            values(null, #{owner} ,#{pinCode} ,#{balance} )")*/
    int save(Account account);

    //@Update("update t_account set owner=#{owner},pin_code=#{pinCode},balance=#{balance} where id = #{id}")
    int update(Account  account);

    //@Delete("delete from t_account where id = #{value}")
    int delete(Serializable id);

    //@Select("select * from t_account")
    List<Account> findAll();

    //@Select("select * from t_account where id = #{value}")
    Account findById(Serializable id);

}
